package main

import (
	"fmt"
	"os"
	"path/filepath"
	"strings"
)

func main() {
	// 输出"Hello, world!"
	basedir := "C:\\Users\\admin\\Desktop\\files\\0115"
	files, _ := os.ReadDir(basedir)
	for _, file := range files {
		// fmt.Println(file.Name())
		fi, err := os.Lstat(basedir + "\\" + file.Name())
		if err != nil {
			println(err)
		}
		mode := fi.Mode()
		if mode.IsDir() {
			innerfiles, _ := os.ReadDir(basedir + "\\" + file.Name())
			for _, innerfile := range innerfiles {
				fname := innerfile.Name()
				if strings.Index(fname, "理论") > 0 {
					fmt.Println(innerfile.Name())
					dirname := strings.Split(innerfile.Name(), ".")[0]
					zipfilename := basedir + "\\" + file.Name() + "\\" + fname
					DecompressZipTo(zipfilename, filepath.Join(basedir, dirname))
				}
				break
			}
		}
	}
}
